/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 */
package com.jeesite.modules.kj.order.entity;

import javax.validation.constraints.NotBlank;
import org.hibernate.validator.constraints.Length;

import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.mapper.query.QueryType;

/**
 * order_itemEntity
 * @author hzy
 * @version 2019-11-29
 */
@Table(name="kj_order_item", alias="a", columns={
		@Column(name="id", attrName="id", label="id", isPK=true),
		@Column(name="item_id", attrName="itemId", label="商品id"),
		@Column(name="order_id", attrName="orderId", label="订单id", isQuery=false),
		@Column(name="num", attrName="num", label="购买数量", isQuery=false),
		@Column(name="title", attrName="title", label="商品标题", isQuery=false),
		@Column(name="price", attrName="price", label="商品单价", isQuery=false),
		@Column(name="total_fee", attrName="totalFee", label="商品总价", isQuery=false),
		@Column(name="pic_path", attrName="picPath", label="商品图片地址", isQuery=false),
		@Column(includeEntity=DataEntity.class),
	}, orderBy="a.update_date DESC"
)
public class KjOrderItem extends DataEntity<KjOrderItem> {
	
	private static final long serialVersionUID = 1L;
	private String itemId;		// 商品id
	private String orderId;		// 订单id
	private Long num;		// 购买数量
	private String title;		// 商品标题
	private Long price;		// 商品单价
	private Long totalFee;		// 商品总价
	private String picPath;		// 商品图片地址
	
	public KjOrderItem() {
		this(null);
	}

	public KjOrderItem(String id){
		super(id);
	}
	
	@NotBlank(message="商品id不能为空")
	@Length(min=0, max=64, message="商品id长度不能超过 64 个字符")
	public String getItemId() {
		return itemId;
	}

	public void setItemId(String itemId) {
		this.itemId = itemId;
	}
	
	@NotBlank(message="订单id不能为空")
	@Length(min=0, max=64, message="订单id长度不能超过 64 个字符")
	public String getOrderId() {
		return orderId;
	}

	public void setOrderId(String orderId) {
		this.orderId = orderId;
	}
	
	public Long getNum() {
		return num;
	}

	public void setNum(Long num) {
		this.num = num;
	}
	
	@Length(min=0, max=255, message="商品标题长度不能超过 255 个字符")
	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}
	
	public Long getPrice() {
		return price;
	}

	public void setPrice(Long price) {
		this.price = price;
	}
	
	public Long getTotalFee() {
		return totalFee;
	}

	public void setTotalFee(Long totalFee) {
		this.totalFee = totalFee;
	}
	
	@Length(min=0, max=255, message="商品图片地址长度不能超过 255 个字符")
	public String getPicPath() {
		return picPath;
	}

	public void setPicPath(String picPath) {
		this.picPath = picPath;
	}
	
}